<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<link rel="stylesheet" href="statics/css/header.css">
<!-- 头部 -->
<header>
    <h1>${ empty title ? '网上书城' : title }</h1>
    <ul>
    	<c:if test="${ empty loginUser }">
	        <li>
	        	<a href="user/login">登录</a> |
	            <a href="user/register">注册</a>
	        </li>
        </c:if>
        <c:if test="${ not empty loginUser }">
	        <li>
	       		<a href="user/detail">${ loginUser.username }</a> |
	       		<a href="user/logout">退出登录</a>
	        </li>
	        <li><a href="cart">购物车</a></li>
	        <li><a href="order">我的订单</a></li>
	        <li><a href="manager">后台管理</a></li>
        </c:if>
        <li><a href="${ pageContext.servletContext.contextPath }">返回首页</a></li>
    </ul>
</header>